import React from 'react';
import LevelSelect from './index';
import { testJson } from './test';

export const test1 = () => (
  <LevelSelect
    visible
    title="选择"
    dataSource={testJson as any}
    onOk={(value) => {
      console.log(value);
    }}
  />
);
export const test2 = () => (
  <LevelSelect
    visible
    title="选择"
    onOk={(value) => {
      console.log(value);
    }}
    fetchData={(current, selected, value) => {
      console.log(current, selected, value);
      switch (current) {
        case 0:
          return [
            {
              label: '手机号码',
              value: 1,
            },
            {
              label: '地址',
              value: 2,
            },
            {
              label: '姓名',
              value: 3,
            },
            {
              label: '性别',
              value: 4,
            },
          ];
        case 1:
          return [
            {
              label: 'PS',
              value: 1,
            },
            {
              label: 'AI',
              value: 2,
            },
            {
              label: 'CAD',
              value: 3,
            },
            {
              label: 'C4D',
              value: 4,
            },
          ];
        default:
          return [
            {
              label: 'java',
              value: 1,
            },
            {
              label: 'html',
              value: 2,
            },
            {
              label: 'react',
              value: 3,
            },
            {
              label: 'vue',
              value: 4,
            },
          ];
      }
    }}
  />
);
